<template>
	<view class="">
		<view class="Topbg">


		</view>

		<view class="move">
			<view class="mode">
				<view style="margin:0 auto 40rpx auto;width: 140rpx;">

					<u-image src="/static/myjifen.png" width="140" height="60"></u-image>
				</view>
				<view class="u-flex u-row-between u-margin-top-80">
					<view class="u-flex">
						<u-image :src="imagesurl+'/images/my_3.png'" width="60" height="60"></u-image>
						<text class="moneny u-margin-left-20">{{moneny}}</text>
					</view>
					<view class="u-flex">
						<view class="btn red" @click="jifenshop">使用</view>

					</view>
				</view>
			</view>

			<view class="mode">

				<view style="margin:0 auto 40rpx auto;width: 140rpx;">

					<u-image src="/static/jifendetail.png" width="140" height="60"></u-image>
				</view>


				<view v-for="(item,index) in list" :key="index" class="List u-flex u-border-bottom u-padding-20">
					<view :class="Number(item.number)<0?'tred':'tblue'">{{item.number}}</view>

					<view>
						<view>{{item.remark}}</view>
						<view style="color: #999;font-size: 20rpx;margin-top: 10rpx;">{{item.createTime}}</view>
					</view>
				</view>

				<u-loadmore :status="status" />


			</view>

		</view>






	</view>
</template>

<script>
	
	import url from '@/common/baseUrl.js';
	
	export default {

		data() {
			return {
				imagesurl: url.imageUrl,
				moneny: "",
				status: 'loadmore',
				page: 1,

				list: []
			}
		},
		methods: {
			infor(){
				this.$u.post('/api/user/information', {
					
				}, {}).then(res => {
				
					this.moneny=res.data.integral;
					
					
					
				}).catch(err => {})
			},
		
			
			
			jifenshop() {
				uni.navigateTo({
					url: "../jifenshop/index"
				})
			},
			jiazai(){
						   this.$u.post('/api/Financial/integral', {
						   
						   }, {}).then(res => {
						    var resList = res.data;
						    if (this.page == 1) {
						    	this.list = []
						    }
						    if (resList.length > 9) {
						    	this.status = 'loadmore'
						    	this.page = this.page + 1
						    } else {
						    	this.status = 'nomore'
						    }
						    this.list = this.list.concat(resList)
						    this.loading = false
						 
						   }).catch(err => {})
			}
		},
		onLoad() {
			this.jiazai()
		},
		onShow() {
			this.infor()
		},
		onReachBottom() {
			if (this.status == 'nomore') {
		
			} else {
				this.jiazai()
			}
		
		},
	}
</script>

<style lang="scss">
	@import 'common.css';
</style>
